package com.example.zhongyingkaoshi.mapper;


import com.example.zhongyingkaoshi.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/*
* 用户表持久化接口
* */

@Mapper
public interface UserMapper {

    //登录

    @Select("select * from sys_user where username=#{username}")
    User findByUserName(@Param("username")String username);

    @Insert("insert into sys_user(username,password,create_time,update_time) values(#{username},#{password},now(),now())")
    void add(@Param("username") String username, @Param("password") String password);
}
